var A = A || {};
A.root = document.getElementById('container');
A.strategy = {
    // 文字列表展示，31-3.js。dom操作较多
    'listPart': function() {
        var s = document.createElement('div'),
            h = document.createElement('h2'),
            p = document.createElement('p'),
            ht = document.createTextNode(data.data.h2),
            pt = document.createTextNode(data.data.p),
            ul = document.createElement('ul'),
            ldata = data.data.li,
            li, strong, span, t, c;
        s.className = 'part';
        h.appendChild(ht);
        p.appendChild(pt);
        p.appendChild(h);
        s.appendChild(h);
        s.appendChild(p);
        for(var i = 0, len = ldata.length; i < len;i++) {
            li = document.createElement('li');
            strong = document.createElement('strong');
            span = document.createElement('span');
            t = document.createTextNode(ldata[i].strong);
            c = document.createTextNode(ldata[i].span);
            strong.appendChild(t);
            span.appendChild(c);
            li.appendChild(strong);
            li.appendChild(span);
            ul.appendChild(li);
        }
        s.appendChild(ul);
        A.root.appendChild(s);
    },
    'codeart': function() {},
    'onlyTitle': function() {},
    'guide': function() {}
}

A.init = function(data) {
    this.strategy[data.type](data);
}
